<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : XSLFO.xsl
    Created on : 24 novembre 2013, 00:30
    Description:
        Purpose of transformation follows.
-->
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version="1.0" >
    <xsl:template match="/emploisdutemps">
        <fo:root>
            <fo:layout-master-set>
                <fo:simple-page-master master-name="A4"
                                       page-width="297mm"
                                       page-height="210mm"
                                       margin-top="1cm"
                                       margin-bottom="1cm"
                                       margin-left="1cm"
                                       margin-right="1cm">
                    <fo:region-body margin="2cm"/>
                    <fo:region-before extent="1cm"/>
                    <fo:region-after extent="1cm"/>
                    <fo:region-start extent="1cm"/>
                    
                    
                    <fo:region-end extent="2cm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>
            <fo:page-sequence master-reference="A4">
                <fo:static-content flow-name="xsl-region-before">
                    <fo:block>Document réalisé par l'équipe 2</fo:block>
                </fo:static-content>
                <fo:flow flow-name="xsl-region-body">
                    <fo:block>
                        <fo:inline color="red">SVTU</fo:inline>
                        <!--color="#FFFFFF"
                        background-color="green"
                        border-color="red"
                        border-style="solid"
                        border-width="2">Contenu-->
                    </fo:block>
                    <fo:table table-layout="fixed" width="200px"
                              border-left-width="5mm"
                              border-right-width="5mm"
                              border-top-width="5mm"
                              space-before.optimum="3pt" text-align="center"
                    >
                        <fo:table-column column-number="1" column-width="80px"/>
                        <fo:table-column column-number="2" column-width="100px"/>
                        <fo:table-column column-number="3" column-width="250px"/>
                        <fo:table-column column-number="4" column-width="200px"/>
                        <fo:table-column column-number="5" column-width="100px"/>
                        <fo:table-header>
                            <fo:table-row>
                                <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                    <fo:block font-weight="bold">Date</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                    <fo:block font-weight="bold">Horaire</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                    <fo:block font-weight="bold">Cours</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                    <fo:block font-weight="bold">Enseignant</fo:block>
                                </fo:table-cell>
                                <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                    <fo:block font-weight="bold">Location</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-header>
                        <xsl:for-each select="cours[parcours='Parcours_SVTU']">
                            <xsl:sort select="datedebut/annee"/>
                            <xsl:sort select="datedebut/mois"/>
                            <xsl:sort select="datedebut/jour"/>
                            <xsl:sort select="datedebut/heure"/>
                            <xsl:sort select="datedebut/minute"/>                   
                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                        <fo:block>
                                            <xsl:value-of select="concat(datedebut/jour,'/',datedebut/mois,'/',datedebut/annee)"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                        <fo:block>
                                            <xsl:value-of select="datedebut/heure"/>:
                                            <xsl:value-of select="datedebut/minute"/> - 
                                            <xsl:value-of select="datefin/heure"/>:
                                            <xsl:value-of select="datefin/minute"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                        <fo:block>
                                            <xsl:value-of select="resume"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border="1pt solid black" display-align="center" height="1.5cm" overflow="hidden" >
                                        <fo:block>
                                            <xsl:value-of select="@enseignant"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border="1pt solid black" display-align="center" height="1cm" overflow="hidden" >
                                        <fo:block>
                                            <xsl:value-of select="location"/>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </xsl:for-each>
                    </fo:table>
                
                    
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>
</xsl:stylesheet>